<template>
  <div style="height: 60px; line-height: 50px; border-bottom: 1px solid #ccc; display: flex">
    <div style="width: 200px; padding-left: 30px; font-weight: bold; font-size: 25px">酒店预定</div>
    <div style="margin-right: 20px;">
      <el-menu mode="horizontal">
        <el-menu-item @click="$router.push('/Home')">首页</el-menu-item>
        <el-sub-menu index="2">
          <template #title>个人中心</template>
          <el-menu-item @click="$router.push('/UserLogin')">登录</el-menu-item>
          <el-menu-item @click="$router.push('/UserRegister')">注册</el-menu-item>
        </el-sub-menu>
        <el-sub-menu index="3">
          <template #title>管理员</template>
          <el-menu-item @click="$router.push('/AdminLogin')">管理员登录</el-menu-item>
          <el-menu-item @click="$router.push('/AdminRegister')">管理员注册</el-menu-item>
        </el-sub-menu>
      </el-menu>
    </div>
  </div>
</template>

<script>
export default {
  name: "Header"
}
</script>

<style scoped>
/* 使用 ::v-deep 或 /deep/ 穿透样式作用域 */
::v-deep .el-menu-item.is-active,
::v-deep .el-sub-menu.is-active .el-sub-menu__title {
  background-color: #ffa500 !important; /* 橘色 */
  color: #fff !important; /* 文字颜色变为白色 */
}

::v-deep .el-menu-item:hover,
::v-deep .el-sub-menu__title:hover {
  background-color: #ffa500 !important; /* 橘色 */
  color: #fff !important; /* 文字颜色变为白色 */
}

::v-deep .el-menu--horizontal .el-menu-item {
  height: 60px;
  line-height: 60px;
  padding: 0 20px;
}

::v-deep .el-menu--horizontal .el-sub-menu .el-sub-menu__title {
  height: 60px;
  line-height: 60px;
  padding: 0 20px;
}
</style>